#ifndef RK3588_PREPROCESS_H
#define RK3588_PREPROCESS_H

#include <opencv2/opencv.hpp>
#include "types/datatype.h"

struct LetterBoxInfo
{
    bool hor;
    int pad;
};

typedef struct {
    int left;
    int top;
    int right;
    int bottom;
} image_rect_t;

typedef struct {
    int x_pad;
    int y_pad;
    float scale;
} letterbox_t;

typedef struct box_rect_t {
    int left;    ///< Most left coordinate
    int top;     ///< Most top coordinate
    int right;   ///< Most right coordinate
    int bottom;  ///< Most bottom coordinate
} box_rect_t;

typedef struct ponit_t {
    int x;
    int y;
} ponit_t;

typedef struct retinaface_object_t {
    int cls;       
    box_rect_t box;  
    float score;      
    ponit_t ponit[5];
} retinaface_object_t;

typedef struct {
    int count;
    retinaface_object_t object[128];
} retinaface_result;


void letterbox(const cv::Mat &img, cv::Mat &img_letterbox, letterbox_t &letter_box, uint32_t width, uint32_t height);
void cvimg2tensor(const cv::Mat &img, uint32_t width, uint32_t height, tensor_data_s &tensor);

#endif